package com.sunwayworld.basemodule.business.result.resource;

import com.sunwayworld.basemodule.business.result.bean.LimsResultBean;
import com.sunwayworld.basemodule.business.result.service.LimsResultService;
import com.sunwayworld.framework.data.page.Page;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;
import com.sunwayworld.framework.support.base.resource.GenericResource;
import com.sunwayworld.framework.support.choosable.resource.GenericChoosableResource;
import com.sunwayworld.module.sys.at.bean.CoreAuditTrailRecordLineBean;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@RequestMapping("/secure/basemodule/business/results")
public interface LimsResultResource extends GenericResource<LimsResultService, LimsResultBean, Long>, GenericChoosableResource<LimsResultService, LimsResultBean, Long> {

    @RequestMapping(value = "/r/{runId}/result-to-columns/queries", method = RequestMethod.POST)
    Page<LimsResultBean> selectResultToColumns(@PathVariable Long runId, RestJsonWrapperBean wrapperBean);

    @RequestMapping(value = "/order-task/{orderTaskId}/update", method = RequestMethod.POST)
    void updateResultByOrderTaskAndAnalyte(@PathVariable Long orderTaskId, RestJsonWrapperBean wrapperBean);

    @RequestMapping(value = {"/task/{taskId}/analyte/{analyteId}"},method = RequestMethod.GET)
    LimsResultBean selectDetailByTaskAndAnalyte(@PathVariable Long taskId, @PathVariable Long analyteId);

    @RequestMapping(value = "/queries/custom", method = RequestMethod.POST)
    Page<LimsResultBean> selectCustomResult(RestJsonWrapperBean wrapper);

    @RequestMapping(value = "/queries/atrecord/{tableName}/{id}", method = RequestMethod.POST)
    Page<CoreAuditTrailRecordLineBean> selectRecordLineList(@PathVariable String tableName, @PathVariable String id);

}
